<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="model.Evento"%>
<%@ page import="model.Usuario"%>
<%@ page import="java.util.*"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script language="JavaScript">
<!--
	function valida_form() {

		var selecao = document.form_cadastra_participante.evento_participante.value;

		if (selecao == "Selecione") {
			alert("Selecione Item!");
			document.consulta_usuario.login.focus();
			return false;
		} else {

			document.forms[1].action = '/cad_evento/ServletCadastraParticipante';
			alert("Ok");
			document.forms[1].submit();
		}

	}
	-->
</script>
<title>Consulta Evento</title>
</head>
<body>

	<%
		ArrayList<Evento> eventos = (ArrayList<Evento>) session
				.getAttribute("eventos");

		if (eventos != null) {
	%>
	<form method="get" name="form_cadastra_participante" action="">
		Selecione.: <select name="evento_participante"
			id="evento_participante">
			<option>Selecione</option>
			<c:forEach var="eventos" items="${eventos}">

				<option>${eventos.nomeEvento}</option>

			</c:forEach>
		</select> <input type="submit" value="Cadastrar Participante"
			onclick="valida_form();">
	</form>
	<%
		}
	%>
</body>
</html>